package proxy.staticProxy;

import proxy.SellHouseService;

/**
 * @Author quan
 * @Description 静态代理
 * @Date 2023/7/27 16:42
 */

//创建代理类
public class StaticProxy implements SellHouseService {
    //将目标对象注入到代理类（），然后在代理类的对应方法调用目标类中的对应方法
    private final SellHouseService sellHouseService;
    public StaticProxy(SellHouseService sellHouseService){
        this.sellHouseService = sellHouseService;
    }
    @Override
    public void sell() {
        System.out.println("before...");
        sellHouseService.sell();
        System.out.println("after...");
    }
}
